package com.comp5511.assignment01;
import java.io.*;

public class StackSinglyLinkListMain {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		try {
			// Instantiated the file reader, load in the TXT file.
			Reader myFileReader = new FileReader("ds13s-a1.txt");
			// Instantiated the stack and load the Filereader 
			//object into the Stack_Method object
			Stack myStack = new Stack(myFileReader);
			// Read the TXT file, line by line
			myStack.fileReader();
			// Show the full list
			myStack.showLinkList();
			// show current top of the stack
			myStack.showCurrentHead();
		} catch (FileNotFoundException e) {
			/*----------------------------------------------------------------------
			 * Exception catch part.used to catch the error when no file was found
			----------------------------------------------------------------------*/
			System.out.println("Error opening the file");
			// Terminate program
			System.exit(0);
		}

	}

}
